import Vue from 'vue'
import VueRouter from 'vue-router'

const CreateArticle = () => import('views/CreateArticle')
const ListArticle = () => import('views/ListArticle')
const EditArticle = () => import('views/EditArticle')

Vue.use(VueRouter)

const routes = [
  {
    path: '',
    redirect: '/articles/list'
  },
  {
    path: '/articles/list',
    component: ListArticle
  },
  {
    path: '/articles/create',
    component: CreateArticle
  },
  {
    path: '/articles/:id/edit',
    component: EditArticle
  }
]

const router = new VueRouter({
  routes
})

export default router
